//  截取字符串
export function sliceStr(str, len = 10) {
  if(typeof str !== 'string') return '';

  return str.slice(0, len);
}

//  截取字符串省略
export function sliceStrAndEllipsis(str, len = 10, ellipsis = '...') {
  if(typeof str !== 'string') return '';

  return str.slice(0, len) + ellipsis;
}